#ifndef NMC_TILEMAP_HPP
#define NMC_TILEMAP_HPP

#include <vector>

#include "point.hpp"
#include "tile/tile.hpp"

namespace nmc
{
	class Actor;
	class EmptyTile;
	class Graphics;
	
	class TileMap
	{
	public:
		TileMap(int width, int height);
		~TileMap();
		void setTile(Tile* tile, int x, int y);
		Tile* getTile(int x, int y);
		void calculateSolidities();
		void resolveCollision(Actor* actor, Point& velocity);
		void draw(Graphics* graphics, Tile::Layer layer);
		void drawTypes(Graphics* graphics);
		void drawSolidities(Graphics* graphics);

	private:
        void resolveCollision(Actor* actor, const Point& position, Point& velocity);

        bool isStandingOnFloor(Actor* actor, const Point& position);

		int mWidth;
		int mHeight;
		Tile** mTiles;
		EmptyTile* mEmptyTile;
	};
}

#endif